<div class="weadmin-body">
    <form class="layui-form" data-form='{:request()->url()}'>

        <div class="layui-form-item">
            <label class="layui-form-label">复选框</label>
            <div class="layui-input-block">
                {volist name="roles" id="role"}
                <input type="checkbox" name="role[{$role.id}]" title="{$role.title}" {if in_array($role.id,$access)}checked{/if}>
                {/volist}
            </div>
        </div>

        <div class="layui-form-item layui-col-xs10 layui-col-xs-offset2">
            {if isset($id)}<input type="hidden" name="id" value="{$id}">{/if}
            <button class="layui-btn" lay-submit="">确定</button>
        </div>
    </form>
</div>

<script>
    layui.use('form',function () {
        layui.form.render();
    })
</script>